package com.neutech.service.impl;
import com.neutech.mapper.PinspectMapper;
import com.neutech.service.PinspectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PinspectServiceImpl implements PinspectService {
    @Autowired
    private PinspectMapper pinspectMapper;
    @Override
    public List<Map<String, Object>> queryPinspectByName(String name) {
        return pinspectMapper.queryPinspectByName(name);
    }
    @Override
    public List<Map<String,Object>>queryInspectByName(String name) {
        return pinspectMapper.queryInspectByName(name);
    }
    @Override
    public void addPinspect(Map<String, Object> map) {

        for (Object key : map.keySet()) {
            Object  value = map.get(key);
            map.put((String) key,value);
        }


        map.put("state","已预约");
        pinspectMapper.addPinspect(map);
    }

    @Override
    public void delpinspect(Integer num) {
        pinspectMapper.delpinspectBynum(num);
    }

    @Override
    public List<Map<String, Object>> queryPinspectByIdnumber(Integer idnumber) {
        return pinspectMapper.queryPinspectByIdnumber(idnumber);
    }
}
